package com.xu.hutool;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.mail.Mail;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;

import java.util.ArrayList;

public class MailTest {
    public static void main(String[] args) {
        MailUtil.send("1254021039@qq.com", "测试", "hutool_SSL邮件测试",false);
//        MailUtil.send("1254021039@ww.com", "测试", "<h1>时间煮雨</h1>", true, FileUtil.file("D:/aaa.xml"));
//
//        ArrayList<String> tos = CollUtil.newArrayList(
//                "121@qq.com",
//                "1211@qq.com",
//                "123@qq.com"
//        );
//        MailUtil.send(tos, "测试", "hutool群发邮件检测",false);
//        // 自定义邮件
//        MailAccount account = new MailAccount();
//        account.setHost("smtp.yeah.net");
//        account.setPort(25);
//        account.setAuth(true);
//        account.setFrom("1254@qq.com");
//        account.setUser("user");
//        account.setPass("123");
//        MailUtil.send(account, CollUtil.newArrayList("123@qq.com"), "测试", "自定义邮件测试", false);
    }
}
